/**
 * 自定义守卫
 * 它只能接收布尔值
 * 语法规则:参数 is 类型
 * 这个函数如果返回true那么这个参数就是你想要的类型
 */
// const isObj = (arg:any) => Object.prototype.toString().call(arg) === '[Object,Object]'
const isNum = (num:any):num is number => typeof num === "number"
const isStr  = (str:any):str is string => typeof str === 'string'
const isFn = (fn:any):fn is Function => typeof fn === 'function'


// @ts-ignore
function did(v){
    if (isNum(v)){
        return v.toFixed(2)
    }
}

console.log(did(32.12312))
